package main.java.tmi.main.service.impl;

import java.sql.SQLException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import main.java.tmi.common.service.impl.AbstractDao;
import main.java.tmi.main.service.MainVO;

import org.springframework.stereotype.Repository;

/**
 * Main Data Access Object (MSO_USER Table)
 *
 * @author min™
 * @since 2012. 04. 15
 */
@Repository
public class MainDAO extends AbstractDao {
	
	/**
	 * 메뉴 목록 조회
	 * @param paramMap 
	 * @return List<MainVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public List<MainVO> listMenu(String roleId) throws SQLException {
		Map<String, String> param = new HashMap<String, String>();
		param.put("roleId", roleId);
		return (List<MainVO>) list("MainDAO.listMenu", param);
	}
	
	/**
	 * 메뉴 목록 조회
	 * @param paramMap 
	 * @return List<MainVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public List<MainVO> listMenuAll(String roleId) throws SQLException {
		Map<String, String> param = new HashMap<String, String>();
		param.put("roleId", roleId);
		return (List<MainVO>) list("MainDAO.listMenuAll", param);
	}
	
	/**
	 * notice 목록 조회
	 * @param paramMap 
	 * @return List<MainVO>
	 * @throws SQLException 
	 */
	@SuppressWarnings("unchecked")
	public List<MainVO> listNotice(String roleId, String custCode) throws SQLException {
		Map<String, String> param = new HashMap<String, String>();
		System.out.println("roleId===================================================="+roleId);
		System.out.println("custCode===================================================="+custCode);
		param.put("roleId", roleId);
		param.put("custCode", custCode);
		return (List<MainVO>) list("MainDAO.listNotice", param);
	}
}
